<div class="contents">
  <ol class="breadcrumb">
    <li><a href="#/index/panel">首页</a></li>
    <li class="active">广告列表</li>
  </ol>
  <form class="form-inline search-box" name="form" role="form" ng-submit="search()" novalidate>
      <div class="form-group">
        <label class="sr-only" >广告位置</label>
        <select ng-model="searchMap.advertPosition" class="form-control" ng-options="m.value as m.text for m in advertPositionModel">
          <option value="">--选择广告位置--</option>        
        </select>
      </div>
      <div class="form-group">
        <input class="form-control" placeholder="标题" name="advertTitle" ng-model="searchMap.advertTitle" style="width:220px;"></input> 
      </div>
      <button type="submit" class="btn btn-primary">查询</button>
  </form>
  <table class="table table-striped table-hover">
    <thead>
      <tr>
        <th width="30">ID</th>
        <th width="150">广告位置</th>
        <th width="">标题</th>
        <th width="150">链接</th>
        <th width="200">图片</th>
        <th width="80">开始日期</th>
        <th width="80">结束日期</th>
        <th width="80">优先级</th>
        <th width="80">状态</th>
        <th width="100">操作</th>
      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="ad in ads">
        <td>{{ad.id}}</td>
        <td>{{ad.advertPosition | advertPositionRender}}</td>
        <td>{{ad.advertTitle}}</td>
        <td><a href="{{ad.linkAddre}}" target="_blank">{{ad.linkAddre}}</a></td>
        <td><a href="{{ad.picAddre}}" target="_blank">{{ad.picAddre}}</a></td>
        <td>{{ad.startTime | date:'yyyy-MM-dd'}}</td>
        <td>{{ad.endTime | date:'yyyy-MM-dd'}}</td>
        <td>{{ad.advertSort}}</td>
        <td><span ng-class="{'text-muted':ad.status=='02','text-primary':ad.status=='01'}">{{ad.status | advertStatusRender}}</span></td>
        <td class="optd">
          <a href="#/ad/edit?id={{ad.id}}">编辑</a>
          <a class="cur-p" ng-click="stop(ad.id)" ng-if="ad.status == '01'">下架</a>
          <a class="cur-p" ng-click="start(ad.id)" ng-if="ad.status == '02'">上架</a>
        </td>
      </tr>
    </tbody>
  </table>

	<div class="pager-box" ng-include src="'tpl/public/pager.html'" ng-show="ads.length > 0"></div>
</div>
